package org.example.oop;

public class CircleArrayTests {
    public static void main(String[] args) {
        Circle[] array=new Circle[2]; //构建引用类型数组
        System.out.println(array[0]); //默认值为null
        array[0]=new Circle("red",10); //这里的值是我们自己构建的对象
        array[1]=new Circle("blue",20);
        for(int i=0;i<array.length;i++) {
            System.out.println(array[i].color + "色圆的周长为" + array[i].doPerimeter());
            System.out.println(array[i].color + "色圆的面积为" + array[i].doArea());
        }
        //定义时初始化
        Circle[] array2={new Circle("black",10),new Circle("yellow",30),};
    }
}

